﻿<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"%>
<%@ page import="nc.vo.sm.UserVO"%>
<%@ page import="nc.bs.ebvp.login.Constant"%>
<%@ page import="nc.bs.ebvp.sourcingcoll.Constants"%>
<%@ page import="nc.bs.ebvppub.ebvpservicefactory.LoadConfigProperty"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%  
	String basePath = request.getContextPath();
	String strProjPk = request.getParameter("pkProj");
	//2：发采购文件环节，3：发布与应答环节
	String type = request.getParameter("type");
	String strParaEc021 = (String) request.getSession().getAttribute(
			Constants.ID_EC021);
	String strParaEc022 = (String) request.getSession().getAttribute(
			Constants.ID_EC022);
	UserVO userVo = (UserVO) request.getSession().getAttribute(
			Constant.USER_INFO);
	boolean isClientCa = false;
	boolean isServerCa = false;
	//供应商客户端是否支持CA
	if ("Y".equalsIgnoreCase(strParaEc021)
			|| (null != userVo.getIsca() && userVo.getIsca()
					.booleanValue())) {
		isClientCa = true;
	}
	//招投标服务器是否支持CA
	if ("Y".equalsIgnoreCase(strParaEc022)) {
		isServerCa = true;
	}
	//CA厂商名称
	String strCaFactory = (String) request.getSession().getAttribute(
			LoadConfigProperty.EBVP_CA_FACTORY);
%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>
		<%
			if ("2".equals(type)) {
		%>
		采购文件应答
		<%
			} else {
		%>
		发布文件应答
		<%
			}
		%>
		</title>
		<script type="text/javascript" src="js/jquery.form.js"></script>
		<%
			if (isClientCa || isServerCa) {
		%>
			<%
				if (Constants.CA_FACTORY_ITRUS.equals(strCaFactory)) {
			%>
				<script type="text/javascript" src="js/itrusforNC.js"></script>
				<script type="text/javascript" src="js/pta.js"></script>
			<%
				} else if (Constants.CA_FACTORY_INFOSEC.equals(strCaFactory)) {
			%>
				<script type="text/javascript" src="js/Infosec4NC.js"></script>
			<%
				} else if (Constants.CA_FACTORY_DEAN.equals(strCaFactory)) {
			%>
				<script type="text/javascript" src="js/DatechJs.js"></script>
			<%
				}
			%>
		<%
			}
		%>
	</head>
	<body class="fullbody">
		<form action="" method="post" name="replyform">
			<input type="hidden" name="casn" value=""/>
			<input type="hidden" name="pk_file" />
			<input type="hidden" name="file_name" />
			<div class="context">
				<div class="position">
					<div class="tposi">
						当前位置：
						<a href="<%=basePath%>/infopub/pubmain"	class="linkstyle">首页</a> &nbsp;&gt;&gt;&nbsp;
						<a href="<%=basePath%>/sourcing/projlist" class="linkstyle">我的投标\谈判\询价</a> &nbsp;&gt;&gt;&nbsp;
						<a href="<%=basePath%>/sourcing/biddingprojlist" class="linkstyle">进行中的项目</a> &nbsp;&gt;&gt;&nbsp;
						<a href="<%=basePath%>/sourcing/biddingprojlist/projexec?pk_pur_project=<%=strProjPk%>" class="linkstyle">${PURPROJECT_FORM.project_name}</a>
						&nbsp;&gt;&gt;&nbsp;
						<span class="curposition">
							<%
								if ("2".equals(type)) {
							%> 采购文件应答 <%
								} else {
							%> 发布文件应答 <%
								}
							%>
						</span>
					</div>
					<%if ("2".equals(type)) {%>
					<div class="help">
						<a href="javascript:void(null);" onclick="doHelp('<%=request.getContextPath()%>/help/html/CGWJYD.html');" class="linkstyle">帮助</a>
					</div>
					 <%} else {%>
					<div class="help">
						<a href="javascript:void(null);" onclick="doHelp('<%=request.getContextPath()%>/help/html/FBWJYD.html');" class="linkstyle">帮助</a>
					</div>
					 <%}%>
				</div>
				<div class="margin8">
				</div>
				<div class="subpage_title">
					<div class="title_index">
						<img src="<%=basePath%>/images/common/dot03.gif" alt="" border="0" />
						&nbsp;<%
							if ("2".equals(type)) {
						%>
						采购文件应答
						<%
							} else {
						%>
						发布文件应答
						<%
							}
						%>
					</div>
				</div>
				<div class="margin20">
	            </div>
				<div class="subpage_bidlist">
					<table width="800" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="13">
								<img src="<%=basePath%>/images/reply/yingda_zbj_001.jpg" width="13" height="76"	border="0" />
							</td>
							<td width="70" background="<%=basePath%>/images/reply/yingda_zbj_002.jpg">
								<img src="<%=basePath%>/images/reply/yingda_z_001.jpg" width="64" height="63" border="0" />
							</td>
							<td width="215" valign="top" background="<%=basePath%>/images/reply/yingda_zbj_002.jpg">
								<table width="215" border="0" cellpadding="0" cellspacing="0" height="62">
									<tr>
										<td height="36" colspan="8" valign="middle" class="f-14-e57c00">
											距离应答截止日期还有
										</td>
									</tr>
									<tr>
										<td width="26" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="day">
										</td>
										<td align="center" class="f-14-b-000000">
											天
										</td>
										<td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="hour">
										</td>
										<td align="center" class="f-14-b-000000">
											时
										</td>
										<td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="minute">
										</td>
										<td align="center" class="f-14-b-000000">
											分
										</td>
										<td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="second">
										</td>
										<td align="center" class="f-14-b-000000">
											秒
										</td>
									</tr>
								</table>
							</td>
							<td width="10" align="left" background="<%=basePath%>/images/reply/yingda_zbj_002.jpg">
								<img src="<%=basePath%>/images/reply/yingda_zbj_004.jpg" width="1" height="57" border="0" />
							</td>
							<td background="<%=basePath%>/images/reply/yingda_zbj_002.jpg" class="f-12-F60000">
								注意：请在应答截止时间前进行应答，超过应答截止时间后进行的应答操作为无效操作！
							</td>
							<td width="13">
								<img src="<%=basePath%>/images/reply/yingda_zbj_003.jpg" alt="" width="13" height="76" border="0" />
							</td>
						</tr>
					</table>
					<table class="replytxt" width="800" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="128" height="15"></td>
							<td width="176"></td>
							<td width="96"></td>
							<td width="210">&quot;</td>
						</tr>
						<tr>
							<td height="35" align="right">
								标书类型：&nbsp;
							</td>
							<td align="left">
								 ${RELEASE_FORM.biddoc_type}
							</td>
							<td height="35" align="right">
								应答文件截止时间：&nbsp;
							</td>
							<td align="left">
								${RELEASE_FORM.bid_end_time}
							</td>
						</tr>
						<tr>
							<td align="right">
								开启时间调整至：&nbsp;
							</td>
							<td align="left">
								${RELEASE_FORM.adjust_time}
							</td>
							<td align="right">
								应答截止时间延长至：&nbsp;
							</td>
							<td align="left">
								${RELEASE_FORM.delayTime}
							</td>
						</tr>
						<tr>
							<td height="35" align="right">
								开启时间：&nbsp;
							</td>
							<td align="left">
								${RELEASE_FORM.unseal_time}
							</td>
							<td align="right">
								开启地点：&nbsp;
							</td>
							<td align="left">
								${RELEASE_FORM.unseal_addr}
							</td>
						</tr>
						<tr>
							<td align="right" valign="top">
								备注：&nbsp;
							</td>
							<td  align="left" valign="bottom">
								<div style="height: 30px; overflow: auto;">
									
								</div>
							</td>
						</tr>
						<tr>
							<td>
								&nbsp;
							</td>
						</tr>
					</table>
					<table width="800" border="0" cellpadding="0" cellspacing="0" height="80" class="releasefile">
						<tr>
							<td height="25" colspan="5" class="filelabel">
								采购文件下载
							</td>
						</tr>
						<tr>
							<td valign="middle">
								<table cellpadding="0" cellspacing="0" class="tableCss" align="center">
									<tr class="titleTr">
										<th width="35">序号</th>
										<th width="301">文件</th>
										<th width="58">类型</th>
										<th width="66">大小</th>
										<%
											if (isServerCa) {
										%>
										<th width="217">备注</th>
										<%
											}else{
										%>
										<th width="258">备注</th>
										<%
											}
										%>
										<th width="41">下载</th>
										
										<%
											if (isServerCa) {
										%>
										<th width="41">应答</th>
										<%
											}else{
										%>
										<th width="41" class="th1">应答</th>
										<%
											}
										%>
										<%
											if (isServerCa) {
										%>
										<th width="41" class="th1">验签</th>
										<%
											}
										%>
									</tr>
									<c:if test="${RELEASE_FILE_FORM != null}">
										<c:forEach items="${RELEASE_FILE_FORM}" var="file">
											<c:if test="${file.index%2==1}">
												<tr align="left" class="contTr-old"  >
											</c:if>
											<c:if test="${file.index%2==0}">
												<tr align="left" class="contTr-even">
											</c:if>
												<td class="td1" >${file.index}</td>
												<td class="td1">
												<input type="hidden" name="pub_file_pk" id="pub_file_pk" value="${file.pk_release_file_b}" />
												<input type="hidden" name="pub_file_name" id="pub_file_name" value="${file.file_name}" />
												${file.file_name}
												</td>
												<td class="td1" >
												<c:if test="${file.file_type == '1'}">
												采购文件
												</c:if>
												<c:if test="${file.file_type == '2'}">
												补充文件
												</c:if>
												</td>
												<td class="td1" ><span id="showSize">${file.file_size/1024}</span>KB<input name="releaseFileSize" id="releaseFileSize" class="textinput5" readonly type="hidden" value="${file.file_size}" /></td>
												<td class="td1">${file.file_note}&nbsp;</td>
												<td class="td1" ><input type="button" class="buttondel" value="下载" onclick="downloadFile('${file.pk_file}','${file.file_name}');" /></td>
												<td class="td1" >
													<c:if test="${file.file_type == '1'}">
														<input type="button" class="buttondel" value="应答"
															onclick="uploadFile('${file.pk_release_file_b}');" />
													</c:if>
												</td>
												<%
													if (isServerCa) {
												%>
												<td class="td1">
													<input name="fileName" type="file" size="5" />
													<input type="button" class="buttondel" value="验签" onclick="verifyFile('${file.signature}','${file.index}');" />
												</td>
												<%
													}
												%>
											</tr>
										</c:forEach>
									</c:if>
								</table>
							</td>
						</tr>
					</table>
	
					<table width="800" border="0" cellpadding="0" cellspacing="0" height="80" class="releasefile">
						<tr>
							<td width="90%" height="25" colspan="4" class="filelabel" align="left">
								投标文件
							</td>
						</tr>
						<tr>
							<td valign="middle">
								<table id="bidFileTable"  cellpadding="0" cellspacing="0"  class="tableCss">
									<tr class="titleTr" >
										<th width="35">序号</th>
										<th width="216">采购文件</th>
										<th width="216">应答文件</th>
										<th width="66">大小</th>
										<th width="226">备注</th>
										<th width="41"  class="th1">删除</th>
									</tr>
									<c:if test="${REPLY_FILE_FORM != null}">
										<c:forEach items="${REPLY_FILE_FORM}" var="file">
											<c:if test="${file.index%2==1}">
												<tr id="${file.pk_file}"  class="contTr-old">
											</c:if>
											<c:if test="${file.index%2==0}">
												<tr id="${file.pk_file}" class="contTr-even">
											</c:if>
												<input type="hidden" id="reply_file_real_path" name="reply_file_real_path" value="${file.real_path}"/>
												<input type="hidden" id="pk_release_file_b" name="pk_release_file_b" value="${file.pk_release_file_b}" />
												<td class="td1" >${file.index}</td>
												<td class="td1" >${file.release_file_name}</td>
												<td class="td1" ><input name="reply_file_name" id="reply_file_name" class="textinput5" readonly type="text" value="${file.file_name}" /></td>
												<td class="td1" ><span id="showSize">${file.file_size/1024}</span>KB<input name="reply_file_size" id="reply_file_size" class="textinput5" readonly type="hidden" value="${file.file_size}" /></td>
												<td class="td1" ><input name="fileMemo" id="fileMemo" style="width:95%"  readonly class="input-unEdit" value="${file.file_note}">&nbsp;</td>
												<%--<td><input type="button" class="buttondel" value="下载" onclick="downloadFile('${file.pk_file}','${file.file_name}');" /></td>
												--%>
												<td class="td1" ><input type="button" class="buttondel" value="删除" onclick="delFile('${file.pk_file}');" /></td>
											</tr>
										</c:forEach>
									</c:if>
								</table>
							</td>
						</tr>
					</table>
					<table width="800" border="0" cellpadding="0" cellspacing="0" class="releasefile">
						<c:if test="${RELEASE_FORM.is_quote == \"true\"}">
						<tr>
							<td width="113" height="28" align="left">
								<span class="filelabel">报价单元</span>
							</td>
							<td width="197" align="center">
								&nbsp;
							</td>
							<td width="113" align="center">
								&nbsp;
							</td>
							<td width="187" align="center">
								&nbsp;
							</td>
						</tr>
						<tr>
							<td height="35" colspan="4" align="left">
								<table  cellpadding="0" cellspacing="0" class="tableCss" >
									<tr class="titleTr">
										<th width="35">序号</th>
										<th width="208">报价单元</th>
										<th width="55">产品项</th>
										<th width="102">合计金额</th>
										<th width="400" class="th1">备注</th>
									</tr>
									<c:forEach items="${PRICE_FORM}" var="price">
										<c:if test="${price.index%2==1}">
												<tr align=" left" class="contTr-old">
											</c:if>
											<c:if test="${price.index%2==0}">
												<tr align=" left" class="contTr-even">
											</c:if>
											<input type="hidden" name="signature" value="${price.signature}"/>
											<input type="hidden" name="pk_pur_project" value="${price.pk_pur_project}"/>
											<input type="hidden" name="pk_purproj_step" value="${price.pk_purproj_step}"/>
											<input type="hidden" name="pk_release_h" value="${price.pk_release_h}"/>
											<input type="hidden" name="pk_pricetplt_h" value="${price.pk_pricetplt_h}"/>
											<input type="hidden" name="pk_supplier" value="${price.pk_supplier}"/>
											<input type="hidden" name="pk_pricedata_h" value="${price.pk_pricedata_h}"/>
											<input type="hidden" name="is_prod_item" value="${price.is_prod_item}"/>
											<td class="td1"  >${price.index}</td>
											<td class="td1" >${price.price_unit}</td>
											<td class="td1" >
											<c:if test="${price.is_prod_item == 'Y' || price.is_prod_item == 'y'}"><input name="is_prod_item_cal" class="textinput5" readonly type="text" value="是" /></c:if>
											<c:if test="${price.is_prod_item == 'N' || price.is_prod_item == 'n'}"><input name="is_prod_item_cal" class="textinput5" readonly type="text" value="否" /></c:if>
											</td>
											<td class="td1" >
											<input name="total_amount" type="text" 
											<c:if test="${price.is_prod_item == 'N' || price.is_prod_item == 'n'}">class="input-edit" </c:if>
											<c:if test="${price.is_prod_item == 'Y' || price.is_prod_item == 'y'}"> class="input-unEdit" readonly</c:if>
											value="${price.total_amount}" onchange="subReduNum(this,'${MONEY_PRECISION}');" onkeypress="javascript:keyPress(this);" />
											</td>
											<td class="td1" >${price.memo}&nbsp;</td>
										</tr>
									</c:forEach>
								</table> 
							</td>
						</tr>
						<c:if test="${RELEASE_FORM.price_tplt_type != \"1\"}">
						<tr>
							<td width="70%" height="28" align="left">
								<span class="filelabel">报价明细</span>
							</td>
							<td width="10%" align="center">
								&nbsp;
							</td>
							<td width="5%" align="center">
								&nbsp;
							</td>
							<td width="15%" align="right">
								<c:if test="${RELEASE_FORM.price_tplt_type != \"2\"}">
									<input type="button" class="buttonadd" value="增加报价信息" onclick="addProdItem();" />
								</c:if>
							</td>
						</tr>
						<tr>
							<td height="35" colspan="4" align="left">
								<table id="prodTable"  cellpadding="0" cellspacing="0" class="tableCss">
									<tr class="titleTr">
										<th  width="35">序号</th>
										<th  width="241">产品</th>
										<th  width="107">数量</th>
										<th  width="165">价格</th>
										<th  width="211">备注</th>
										<th  width="41" class="th1">删除</th>
									</tr>
									<c:forEach items="${PRICE_DETAIL_FORM}" var="pricedetail">
										<c:if test="${pricedetail.detail_index%2==1}">
											<tr id="${pricedetail.detail_index}" align="left" class="contTr-old" >
										</c:if>
										<c:if test="${pricedetail.detail_index%2==0}">
											<tr id="${pricedetail.detail_index}"  align="left" class="contTr-even">
										</c:if>
											<input type="hidden" name="pk_pricedata_b" value="${pricedetail.pk_pricedata_b}"/>
											<input type="hidden" name="detail_pk_pricetplt_h" value="${pricedetail.pk_pricetplt_h}"/>
											<input  type="hidden" name="pk_pricetplt_b" value="${pricedetail.pk_pricetplt_b}"/>
											<input type="hidden" name="pk_prod" value="${pricedetail.pk_prod}"/>
											<input type="hidden" name="pk_prod_v" value="${pricedetail.pk_prod_v}"/>
											<input type="hidden" name="pk_prod_cls" value="${pricedetail.pk_prod_cls}"/>
											<input type="hidden" name="pk_prod_unit" value="${pricedetail.pk_prod_unit}"/>
											<input type="hidden" name="prod_src" value="${pricedetail.prod_src}"/>
											<input type="hidden" name="amount_precision" value="${pricedetail.amount_precision}" />
											
											<td class="td1" width="5%">
												<input name="row_id" style="border-style:none;width: 30px" class="input-unEdit" type="text" value="${pricedetail.detail_index}" />
											</td>
											<!-- 如果来自后台代替应答报价（包含来自价格模板和代替应答添加的结构化和非结构化产品） -->
											<c:if test="${(pricedetail.pk_pricetplt_b != null && (null == pricedetail.pricedata_src || ''==pricedetail.pricedata_src))
											||(pricedetail.pk_pricetplt_b == null && pricedetail.prod_src !='3' && (null == pricedetail.pricedata_src || ''==pricedetail.pricedata_src))}">
												<!-- 产品信息 -->
												<td class="td1">
													<input type="hidden" name="prod_name" value="${pricedetail.prod_name}"/>
													<span class="prodName">
														<c:if test="${pricedetail.prod_name != null && '' !=pricedetail.prod_name}">													
														${pricedetail.prod_name}
														</c:if>
														<c:if test="${pricedetail.prod_name == null || '' ==pricedetail.prod_name}">													
														${pricedetail.config_note}
														</c:if>
													</span><br/>
													供方产品编码:<input name='sup_prodcode' type='text' id='sup_prodcode' style='width: 78px' class='input-edit'  value='${pricedetail.sup_prodcode}'/><br/>
													<c:if test="${pricedetail.prod_spec != null && ''!=pricedetail.prod_spec }"> 规格:${pricedetail.prod_spec}<br/></c:if>
													<input name='prod_spec' type='hidden' id='prod_spec' value='${pricedetail.prod_spec}'/>
													<c:if test="${pricedetail.prod_type != null && ''!=pricedetail.prod_type}"> 型号:${pricedetail.prod_type}<br/></c:if>
													<input name='prod_type' type='hidden' id='prod_type' value='${pricedetail.prod_type}'/>
													<c:if test="${pricedetail.project != null && ''!= pricedetail.project }"> 项目:${pricedetail.project}<br/></c:if>
													<c:if test="${pricedetail.producer != null && ''!=pricedetail.producer}"> 生产厂商:${pricedetail.producer}<br/></c:if>
													<c:if test="${pricedetail.asistantproperty != null && '' !=pricedetail.asistantproperty}"> 描述:${pricedetail.asistantproperty}</c:if>
													<c:if test="${pricedetail.asistantproperty != null && '' !=pricedetail.asistantproperty&&pricedetail.config_note != null && '' !=pricedetail.config_note}">,${pricedetail.config_note}</c:if>
													<c:if test="${(pricedetail.prod_name != null && '' !=pricedetail.prod_name)&&(pricedetail.asistantproperty == null || '' ==pricedetail.asistantproperty)&&pricedetail.config_note != null && '' !=pricedetail.config_note}">描述:${pricedetail.config_note}</c:if>
													<input type="hidden" name="config_note" value="${pricedetail.config_note}"/>
												</td>
												<!-- 数量 -->
												<td class="td1">
													<c:if test="${null != pricedetail.amount && '' != pricedetail.amount && 'null'!= pricedetail.amount}">
														<input style="width:50px;color:#006ff2;"  name="amount" class="input-unEdit" readonly type="text" value="${pricedetail.amount}" />
														 ${pricedetail.prod_unit_name}
														<input type="hidden" name="prod_unit_name" value="${pricedetail.prod_unit_name}"/>
													</c:if>
													<!-- 计算时候需要用到 -->
													<c:if test="${null == pricedetail.amount || '' == pricedetail.amount || 'null'== pricedetail.amount}">
														<input type="hidden"  name="amount" class="input-unEdit" readonly type="text" value="${pricedetail.amount}" />
														 <input type="hidden" name="prod_unit_name" value="${pricedetail.prod_unit_name}"/>
													</c:if>
												</td>
												<!--价格-->
												<td class="td1">
													含税单价:<input  name="has_tax_price"  class="input-edit"   type="text" value="${pricedetail.has_tax_price}" onchange="subReduNum(this,'${PRICE_PRECISION}');doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);"/>
													<br/>
													折扣率：<input   name="detail_discount"  class="input-edit"   type="text"  value="${pricedetail.detail_discount}" onchange="subReduNum(this,2);doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);" />
													<br/>
													税率 :<input  name="tax_rate" type="text"  class="input-edit"   value="${pricedetail.tax_rate}" onchange="subReduNum(this,2);doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);" />
													<br/>
													折后价:<input style="color:#006ff2;"  name="discount_net_price" class="input-unEdit"   readonly type="text" value="${pricedetail.priceAfterDiscount}" />
													<br/>
													折后金额:<input style="color:#006ff2;"   name="discount_net_sum"  class="input-unEdit"   readonly type="text" value="${pricedetail.amountAfterDiscount}" />
												</td>
												<!--备注-->
												<td class="td1">
													<textarea name='memo'  type="hidden" style='width:0;' rows='0' type='text' id='memo' value=''></textarea>
													${pricedetail.memo} &nbsp;
												</td>
											</c:if>
											<!-- 如果来自统一定价 门户不可修改 -->
											<c:if test="${pricedetail.pk_pricetplt_b != null && null != pricedetail.pricedata_src}">
												<!-- 产品信息 -->
												<td class="td1">
													<input type="hidden" name="prod_name" value="${pricedetail.prod_name}"/>
													<span class="prodName">${pricedetail.prod_name}</span><br/>
													供方产品编码:<input name='sup_prodcode' type='text' id='sup_prodcode' style='width: 78px' class='input-unEdit' readonly value='${pricedetail.sup_prodcode}'/><br/>
													<c:if test="${pricedetail.prod_spec != null && ''!=pricedetail.prod_spec }"> 规格:${pricedetail.prod_spec}<br/></c:if>
													<input name='prod_spec' type='hidden' id='prod_spec'  value='${pricedetail.prod_spec}'/>
													<c:if test="${pricedetail.prod_type != null && ''!=pricedetail.prod_type}"> 型号:${pricedetail.prod_type}<br/></c:if>
													<input name='prod_type' type='hidden' id='prod_type'  value='${pricedetail.prod_type}'/>
													<c:if test="${pricedetail.project != null && ''!= pricedetail.project }"> 项目:${pricedetail.project}<br/></c:if>
													<c:if test="${pricedetail.producer != null && ''!=pricedetail.producer}"> 生产厂商:${pricedetail.producer}<br/></c:if>
													<c:if test="${pricedetail.asistantproperty != null && '' !=pricedetail.asistantproperty}"> 描述:${pricedetail.asistantproperty}</c:if>
													<c:if test="${pricedetail.asistantproperty != null && '' !=pricedetail.asistantproperty&&pricedetail.config_note != null && '' !=pricedetail.config_note}">,${pricedetail.config_note}</c:if>
													<c:if test="${(pricedetail.asistantproperty == null || '' ==pricedetail.asistantproperty)&&pricedetail.config_note != null && '' !=pricedetail.config_note}">描述:${pricedetail.config_note}</c:if>
													<input type="hidden" name="config_note" value="${pricedetail.config_note}"/>
												</td>
												<!-- 数量 -->
												<td class="td1">
													<c:if test="${null != pricedetail.amount && '' != pricedetail.amount && 'null'!= pricedetail.amount}">
														<input style="width: 50px;color:#006ff2;"  name="amount" class="input-unEdit" readonly type="text" value="${pricedetail.amount}" />
														 ${pricedetail.prod_unit_name}
														<input type="hidden" name="prod_unit_name" value="${pricedetail.prod_unit_name}"/>
													</c:if>
													<!-- 计算时候需要用到 -->
													<c:if test="${null == pricedetail.amount || '' == pricedetail.amount || 'null'== pricedetail.amount}">
														<input type="hidden"  name="amount" class="input-unEdit" readonly type="text" value="${pricedetail.amount}" />
														 <input type="hidden" name="prod_unit_name" value="${pricedetail.prod_unit_name}"/>
													</c:if>
												</td>
												<!--价格-->
												<td class="td1">
													含税单价:<input style="color:#006ff2;" name="has_tax_price"  class="input-unEdit"  type="text" value="${pricedetail.has_tax_price}" onchange="subReduNum(this,'${PRICE_PRECISION}');doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);"/>
													<br/>
													折扣率：<input style="color: #006ff2"  name="detail_discount"  class="input-unEdit"   type="text"  value="${pricedetail.detail_discount}" onchange="subReduNum(this,2);doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);" />
													<br/>
													税率 :<input style="color: #006ff2" name="tax_rate" type="text" class="input-unEdit"   value="${pricedetail.tax_rate}" onchange="subReduNum(this,2);doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);" />
													<br/>
													折后价:<input style="color:#006ff2;"  name="discount_net_price" class="input-unEdit"   readonly type="text" value="${pricedetail.priceAfterDiscount}" />
													<br/>
													折后金额:<input style="color:#006ff2;"   name="discount_net_sum"  class="input-unEdit"   readonly type="text" value="${pricedetail.amountAfterDiscount}" />
												</td>
												<!--备注-->
												<td class="td1">
													<textarea name='memo'  type="hidden" style='width:0;' rows='0' type='text' id='memo' value=''></textarea>
													${pricedetail.memo}&nbsp;
												</td>
											</c:if>
											<!-- 门户自己添加产品 -->
											<c:if test="${pricedetail.pk_pricetplt_b == null &&  pricedetail.prod_src =='3'}">
												<!-- 产品信息 -->
												<td class="td1">
													<input type="hidden" name="prod_name" value="${pricedetail.prod_name}"/>
													供方产品编码:<input name='sup_prodcode' type='text' id='sup_prodcode' style='width: 78px' class='input-edit' value='${pricedetail.sup_prodcode}'/><br/>
													规格:<input name='prod_spec' type='text' id='prod_spec' style='width: 100px' class='input-edit' value='${pricedetail.prod_spec}'/><br/>
													型号:<input name='prod_type' type='text' id='prod_type' style='width: 100px' class='input-edit' value='${pricedetail.prod_type}'/><br/>
													产品描述:<br/><input name='config_note' type='text' id='config_note' style='width: 200px' class='input-edit' value='${pricedetail.config_note}'/>
												</td>
												<!-- 数量 -->
												<td class="td1">
													数量:<input  style='width:50px;' name="amount" class="input-edit" type="text" value="${pricedetail.amount}" onchange="subReduNum(this,'${pricedetail.amount_precision}');doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);" />
													</br>单位:<input  style='width:50px' name="prod_unit_name" type="text" class="input-edit" value="${pricedetail.prod_unit_name}" />
												</td>
												<!--价格-->
												<td class="td1">
													含税单价:<input name="has_tax_price"   class="input-edit"  type="text" value="${pricedetail.has_tax_price}" onchange="subReduNum(this,'${PRICE_PRECISION}');doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);"/>
													<br/>
													折扣率：<input name="detail_discount"   class="input-edit"   type="text"  value="${pricedetail.detail_discount}" onchange="subReduNum(this,2);doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);" />
													<br/>
													税率 :<input  name="tax_rate"   class="input-edit" type="text"   value="${pricedetail.tax_rate}" onchange="subReduNum(this,2);doCalPrice('${pricedetail.detail_index}');" onkeypress="javascript:keyPress(this);" />
													<br/>
													折后价:<input style="color:#006ff2;"  name="discount_net_price" class="input-unEdit"   readonly type="text" value="${pricedetail.priceAfterDiscount}" />
													<br/>
													折后金额:<input style="color:#006ff2;"   name="discount_net_sum"  class="input-unEdit"   readonly type="text" value="${pricedetail.amountAfterDiscount}" />
												</td>
												<!--备注-->
												<td class="td1">
													<textarea name='memo' style='width:100%;' rows='5' type='text' id='memo' >${pricedetail.memo}</textarea>
												</td>
											</c:if>
											<td class="td1">
												<input type="button" class="buttondel" value="删除" onclick="removeProdItem(${pricedetail.detail_index});" />
											</td>
										</tr>
									</c:forEach>
								</table>
								<p class="protext" id="div_content" name="div_content">
									<br />
								</p>
							</td>
						</tr>
						</c:if>
						</c:if>
						<tr>
							<td colspan="4" align="right" valign="top">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="8%" align="left" valign="top" style="font-size: 12px;">
											应答说明：
										</td>
										<td width="92%" align="left">
											<textarea name="reply_note" id="textarea21" style="width:100%"  rows="5" onfocus="select()"><c:if test="${REPLY_FORM.reply_note != null}">${REPLY_FORM.reply_note}</c:if></textarea>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td colspan="4" align="right" valign="top">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<td width="50%" height="28" align="left" style="font-size: 12px;">
										<span>提交人：</span>
										<span><c:if test="${REPLY_FORM.commit_psn_name != null}">${REPLY_FORM.commit_psn_name}</c:if></span>
									</td>
									<td width="50%" height="28" align="left" style="font-size: 12px;">
										<span>提交时间：</span>
										<span><c:if test="${REPLY_FORM.commit_time != null}">${REPLY_FORM.commit_time}</c:if></span>
									</td>
								</table>
							</td>
						</tr>
						<tr><td width="100%" height="28" align="left" style="font-size: 12px; color:red" colspan="4" id="msg"></td></tr>
						<tr>
							<td colspan="4" align="right" valign="top">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<td width="113" height="40" align="center">
										&nbsp;
									</td>
									<td width="197" align="right">
										<input type="button" class="buttonok" value="提交" onclick="doReply();" />
									</td>
									<td width="187" align="center">
										&nbsp;
									</td>
								</table>
							</td>
						</tr>
					</table>		
				</div>
			</div>
		</form>
		<form id="calpriceform" name="calpriceform" method="post" action="<%=basePath%>/sourcing/biddingprojlist/calprice">
			<!-- 集团 -->
			<input type="hidden" id="pk_group_cal" name="pk_group_cal" value="${PURPROJECT_FORM.pk_group}"/>
			<input type="hidden" id="pk_org_cal" name="pk_org_cal" value="${PURPROJECT_FORM.pk_org}"/>
			<!-- 产品 -->
			<input type="hidden" id="pk_prod_cal" name="pk_prod_cal" value=""/>
			<!-- 报价币种 -->
			<input type="hidden" id="pk_currency_cal" name="pk_currency_cal" value="${PURPROJECT_FORM.pk_currency}"/>
			<!-- 报价单位 -->
			<input type="hidden" id="pk_unit_cal" name="pk_unit_cal" value=""/>
			<!-- 主单位 -->
			<input type="hidden" id="pk_primary_unit_cal" name="pk_primary_unit_cal" value=""/>
			<!-- 报价数量 -->
			<input type="hidden" id="amount_cal" name="amount_cal" value=""/>
			<!-- 主数量 -->
			<input type="hidden" id="primary_amount_cal" name="primary_amount_cal" value=""/>
			<!-- 换算率 -->
			<input type="hidden" id="conversion_rate_cal" name="conversion_rate_cal" value=""/>
			<!-- 扣税类别 -->
			<input type="hidden" id="tax_type_cal" name="tax_type_cal" value=""/>
			<!-- 税率 -->
			<input type="hidden" id="tax_rate_cal" name="tax_rate_cal" value=""/>
			<!-- 折扣率 -->
			<input type="hidden" id="discount_rate_cal" name="discount_rate_cal" value=""/>
			<!-- 含税单价 -->
			<input type="hidden" id="has_tax_price_cal" name="has_tax_price_cal" value=""/>
			<!-- 含税金额 -->
			<input type="hidden" id="has_tax_sum_cal" name="has_tax_sum_cal" value=""/>
			<!-- 含税净价 -->
			<input type="hidden" id="has_tax_net_price_cal" name="has_tax_net_price_cal" value=""/>
			<!-- 主含税净价 -->
			<input type="hidden" id="primary_hastax_net_price_cal" name="primary_hastax_net_price_cal" value=""/>
			<!-- 无税单价 -->
			<input type="hidden" id="no_tax_price_cal" name="no_tax_price_cal" value=""/>
			<!-- 无税金额 -->
			<input type="hidden" id="no_tax_sum_cal" name="no_tax_sum_cal" value=""/>
			<!-- 无税净价 -->
			<input type="hidden" id="no_tax_net_price_cal" name="no_tax_net_price_cal" value=""/>
			<!-- 主无税净价 -->
			<input type="hidden" id="primary_notax_net_price_cal" name="primary_notax_net_price_cal" value=""/>
			<!-- 价税合计 -->
			<input type="hidden" id="price_tax_sum_cal" name="price_tax_sum_cal" value=""/>
			<input type="hidden" id="tax_sum_cal" name="tax_sum_cal" value=""/>
			<!-- 计算字段顺序 -->
			<input type="hidden" id="property_cal" name="property_cal" value="has_tax_price|amount"/>
		</form>
		<script language="javascript">
			//合计金额
			var totalAmount = document.getElementsByName("total_amount");
			//数量
			var amount = document.getElementsByName("amount");
			var amountPrecision = document.getElementsByName("amount_precision");
			//含税单价
			var hasTaxPrice = document.getElementsByName("has_tax_price");
			//税率
			var taxRate = document.getElementsByName("tax_rate");
			//折扣率
			var detailDiscount = document.getElementsByName("detail_discount");
			//折后价（含税净价或者无税竞价，统一取含税净价）
			var hasTaxNetPrices = document.getElementsByName("discount_net_price");
			//折后金额（价税合计）
			var priceTaxSums = document.getElementsByName("discount_net_sum");
			var editRow = 0;
			function doCalPrice(index){
				//计算行号
				editRow = 0;
				var rowId = document.getElementsByName("row_id");
				for(var i=0;i<rowId.length;i++){
					if(rowId[i].value == index){
						editRow = i;
						break;
					}
				}
				//物料主健
				var prodPks = document.getElementsByName("pk_prod_v");
				if(prodPks.length > editRow){
					document.calpriceform.pk_prod_cal.value = prodPks[editRow].value;
				}
				//报价单位
				var prodUnitPks = document.getElementsByName("pk_prod_unit");
				if(prodUnitPks.length > editRow){
					document.calpriceform.pk_unit_cal.value = prodUnitPks[editRow].value;
				}
				//数量
				var amounts = document.getElementsByName("amount");  
				document.calpriceform.amount_cal.value = amounts[editRow].value;
				//含税单价
				var hasTaxPrices = document.getElementsByName("has_tax_price");
				if(hasTaxPrices[editRow].value == "" || hasTaxPrices[editRow].value == null){
					return;
				}
				document.calpriceform.has_tax_price_cal.value = hasTaxPrices[editRow].value;
				//税率
				var taxRates = document.getElementsByName("tax_rate");
				if(taxRates[editRow].value == "" || taxRates[editRow].value == null){
					taxRates[editRow].value = "0.00";
				}
				document.calpriceform.tax_rate_cal.value = taxRates[editRow].value;
				//折扣率
				var discountRates = document.getElementsByName("detail_discount");
				if(discountRates[editRow].value == "" || discountRates[editRow].value == null){
					return;
				}
				document.calpriceform.discount_rate_cal.value = discountRates[editRow].value;
				//提交表单
				var options2 = {
					beforeSubmit : showRequest2, 
					success : showResponse2
				};
				$('#calpriceform').ajaxSubmit(options2);
			}
		
			function showRequest2(formData, jqForm, options) {
				//alert("formData:="+formData);
			}
			
			function showResponse2(responseText, statusText, xhr, $form) {
				//alert(responseText);
				// 0:报价数量|1:税率|2:折扣率|3:含税单价|4:价税合计（含税金额）|5:含税净价|6:主含税净价|7:无税单价|8:无税金额|9:无税净价|10:主无税净价|11:税e
				var responseArr = responseText.split("|");
				//含税单价
				var hasTaxPrices = document.getElementsByName("has_tax_price");
				hasTaxPrices[editRow].value = responseArr[3];
				//税率
				var taxRates = document.getElementsByName("tax_rate");
				taxRates[editRow].value = responseArr[1];
				//折扣率
				var discountRates = document.getElementsByName("detail_discount");
				discountRates[editRow].value = responseArr[2];
				//折后价（含税净价或者无税竞价，统一取含税净价）
				var hasTaxNetPrices = document.getElementsByName("discount_net_price");
				hasTaxNetPrices[editRow].value = responseArr[5];
				//折后金额（价税合计）
				var priceTaxSums = document.getElementsByName("discount_net_sum");
				if(null != responseArr[4] && "null" != responseArr[4] && "undefined" != typeof responseArr[4]){
					priceTaxSums[editRow].value = responseArr[4];
				}else{
					priceTaxSums[editRow].value = "";
				}
				//更新报价单元合计数据
				var isProdItem = document.getElementsByName("is_prod_item_cal");
				var totalAmount = document.getElementsByName("total_amount");
				for(var i=0;i<isProdItem.length;i++){
					if(isProdItem[i].value == "是"){
						totalAmount[i].value = "";
						for(var j=0;j<priceTaxSums.length;j++){
							if(priceTaxSums[j].value != "" && priceTaxSums[j].value != null){
								if(totalAmount[i].value != "" && priceTaxSums[i].value != null){
									totalAmount[i].value = parseFloat(totalAmount[i].value) + parseFloat(priceTaxSums[j].value);
								}else{
									totalAmount[i].value = parseFloat(priceTaxSums[j].value);
								} 
							}
						}
						subReduNum(totalAmount[i],'${MONEY_PRECISION}');
						break;
					}
				}
			}
			
			//设置时间控制对象
			var change  = new timechange();
			//设置时间长度
			change.setDistance(${DISMILL});
			//唤醒计算时间的方法
			wakeInterval();
			
			//提交响应信息
			function doReply(){
				//前台校验
				if("${DISMILL}" == "0"){
					alert("已过应答期限，无法提交！");
					return;
				}
				//非延时开启判断环节是否终止完成
				if (""=="${RELEASE_FORM.delayTime}"&&("${STEP_STATUS}" == "3" || "${STEP_STATUS}" == "4")) {
					alert("环节已完成或终止，无法提交！");
					return;
				}
				if(checkInput()){
					//签名
					var bResult = true;
					<%if (isClientCa) {%>
						bResult = doVerifyPriceData();
					<%}%>
					//提交表单
					if(bResult){
						document.replyform.action = "<%=basePath%>/sourcing/biddingprojlist/purfilereply"+"?type=<%=type%>";
						document.replyform.submit();
					}
				}
			}
			
			//校验必输项
			function checkInput(){
				var bResult = true;
				var msg = "";
				var cellItems = new Array();
				cellItems[0] = amount;
				cellItems[1] = hasTaxPrice;
				cellItems[2] = taxRate;
				cellItems[3] = detailDiscount;
				var cellNames = new Array();
				cellNames[0] = "数量";
				cellNames[1] = "含税单价";
				cellNames[2] = "税率";
				cellNames[3] = "折扣率";
				//数量
				var fieldValue;

				if("Y" == "${PURPROJECT_FORM.isPartPrice}"){
					var count = 0;
					for(var i=0;i<hasTaxPrice.length;i++){
						if("" !=cellItems[1][i].value && !isNaN(cellItems[1][i].value)){
							count++;
							}
					}
					if(count == 0 && hasTaxPrice.length>0){
						alert("请录入部分产品报价信息!");
						return false;
					}
				}

				//检查报价明细的数量、含税单价、税率、折扣率
				for(var i=0;i<amount.length;i++){
					for(var j=0;j<cellItems.length;j++){
						cellItems[j][i].value = trim(cellItems[j][i].value);
						fieldValue = cellItems[j][i].value;

						if(fieldValue == "" && "N" == "${PURPROJECT_FORM.isPartPrice}"){
							if(null != msg){
								msg = msg + "\r\n";
							}
							msg = msg + "报价明细第" + (i+1) + "行" + cellNames[j] + "不能为空！";
						}else if(isNaN(fieldValue)){
							if(null != msg){
								msg = msg + "\r\n";
							}
							msg = msg + "报价明细第" + (i+1) + "行" + cellNames[j] + "必须为数字！";
						}
					}
				}
				//检查报价单元的合计金额
				for(var i=0;i<totalAmount.length;i++){
					totalAmount[i].value = trim(totalAmount[i].value);
					fieldValue = totalAmount[i].value;
					if(fieldValue == ""){
						if(null != msg){
							msg = msg + "\r\n";
						}
						msg = msg + "报价单元第" + (i+1) + "行合计金额不能为空！";
					}else if(isNaN(fieldValue)){
						if(null != msg){
							msg = msg + "\r\n";
						}
						msg = msg + "报价单元第" + (i+1) + "行合计金额必须为数字！";
					}
				}
				if(msg != ""){
					alert(msg);
					bResult = false;
				}
				return bResult;
			}
			
			//报价数据签名
			function doVerifyPriceData(){
				//报价单元合计金额
				var totalPrice = document.getElementsByName("total_amount");
				//是否产品项
				var isProdItem = document.getElementsByName("is_prod_item");
				//产品明细报价
				//数量
				var amount = document.getElementsByName("amount");
				//含税单价
				var hasTaxPrice = document.getElementsByName("has_tax_price");
				//税率
				var taxRate = document.getElementsByName("tax_rate");
				//折扣率
				var detailDiscount = document.getElementsByName("detail_discount");
				//待签名消息串
				var strVerifyPriceData = "";
				//证书SN
				var strSn = getSN("${USER_CODE}");
				if(strSn == null || strSn == ""){
					alert("请插入Key后再进行操作！");
					return false;
				}
				document.replyform.casn.value = strSn;
				for(var i=0;i<totalPrice.length;i++){
					strVerifyPriceData = totalPrice[i].value + "|";
					if(isProdItem[i].value == "Y" && amount != null){
						for(var j=0;j<amount.length;j++){
							strVerifyPriceData = strVerifyPriceData + amount[j].value + "|";
							strVerifyPriceData = strVerifyPriceData + hasTaxPrice[j].value + "|";
							strVerifyPriceData = strVerifyPriceData + taxRate[j].value + "|";
							strVerifyPriceData = strVerifyPriceData + detailDiscount[j].value + "|";
						}
					}
					//签名
					document.getElementsByName("signature")[i].value = signmessage(strVerifyPriceData,"${USER_CODE}");
				}
				return true;
			}
			
			//增加报价信息
			//设置供应商已经报价的个数
			var intProdCount = "${PRICE_COUNT}";
			function addProdItem(){
				var prodTable = document.getElementById("prodTable");
				var row = prodTable.insertRow();
		 		intProdCount++;
		 		row.id = intProdCount;
		 		if(row.id%2==0){
			 		row.className="contTr-even";
			 	}else{
			 		row.className="contTr-old";
				 }
				 row.align = 'left';
				//序号
		 		var cell = row.insertCell();
		 		cell.className="td1";
		 		cell.innerHTML = "<input name='row_id' style='border-style:none;width: 30px' class='input-unEdit'  type='text' value='"+intProdCount+"' />";
				//产品名称
				cell = row.insertCell();
				cell.className="td1";
		 		cell.innerHTML = "<input type='hidden' name='pk_pricetplt_b' value=''/>" 
		 		+"<input type='hidden' name='pk_pricedata_b' value=''/>"
		 		+"<input type='hidden' name='detail_pk_pricetplt_h' value=''/>"
		 		+"<input type='hidden' name='pk_prod' value=''/>"
		 		+"<input type='hidden' name='pk_prod_v' value=''/>"
		 		+"<input type='hidden' name='pk_prod_cls' value=''/>"
		 		+"<input type='hidden' name='pk_prod_unit' value=''/>"
		 		+"<input type='hidden' name='prod_src' value=''/>"
		 		+"<input type='hidden' name='prod_name' value=''/>"
			 	+"供方产品编码:<input name='sup_prodcode' type='text' id='sup_prodcode' style='width: 78px' class='input-edit' value='' />"
				+"<br/>规格:<input name='prod_spec' type='text' id='prod_spec' style='width: 100px' class='input-edit' value=''/>"
				+"<br/>型号:<input name='prod_type' type='text' id='prod_type' style='width: 100px' class='input-edit' value=''/>"
				+"<br/>产品描述:<br/><input name='config_note' type='text' id='config_note' style='width: 200px' class='input-edit' value='' />"
				//数量
				cell = row.insertCell();
		 		cell.className="td1";
		 		cell.innerHTML = "数量:<input name='amount' style='width: 50px;' type='text' id='amount' class='input-edit' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this);' value='' />"
				+"<br/>单位:<input name='prod_unit_name'  style='width: 50px' type='text'  class='input-edit' value=''/>";
		 		//价格
				cell = row.insertCell();
				cell.className="td1";
		 		cell.innerHTML = "含税单价:<input name='has_tax_price'   type='text' id='has_tax_price' class='input-edit' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this);' value='' />"
				+"<br/>折扣率:<input name='detail_discount'  type='text' id='detail_discount'  class='input-edit' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this);' value='' />"
				+"<br/>税率:<input name='tax_rate'  type='text' id='tax_rate' class='input-edit' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this);' value='' />"
				+"<br/>折后价:<input name='discount_net_price' style='color:#006ff2' type='text' id='discount_net_price'  class='input-unEdit' value='' />"
				+"<br/>折后金额:<input name='discount_net_sum' style='color:#006ff2' type='text' id='discount_net_sum' readonly class='input-unEdit' value='' />";
		 		// 备注
				cell = row.insertCell();
		 		cell.className="td1";
		 		cell.innerHTML = "<textarea name='memo' style='width:100%;' rows='5' type='text' id='memo' value=''/>";
		 		//删除按钮
		 		cell = row.insertCell();
		 		cell.className="td1";
		 		cell.innerHTML = "<input type='button' class='buttondel' value='删除' onclick='removeProdItem("+intProdCount+")' />";
			}
			
			//删除报价行
			function removeProdItem(index) {
				var prodTable = document.getElementById("prodTable");
				if (prodTable != null) {
					// 获取报价信息有多少行
					var rows = prodTable.rows;
					if (rows != null && rows.length > 0) {
						for ( var pos = 0; pos < rows.length; pos++) {
							var row = rows[pos];
							// 寻找要删除的row
							if (row.id == index) {
								priceTplId = document.getElementsByName("pk_pricetplt_b")[pos-1].value;
								if(null != priceTplId && undefined !== priceTplId && "" != priceTplId){
									alert("不能删除来自价格模板的产品信息！");
									return;
								}
								// 删除对应的报价信息
								prodTable.deleteRow(pos);
								break;
							}
						}
					}
				}
			}
			
			//上传文件
			function uploadFile(pk_release_file_b){
				<%if (isClientCa) {%>
					var strSn = getSN("${USER_CODE}");
					if(strSn == null || strSn == ""){
						alert("请插入Key后再进行操作！");
						return;
					}
				<%}%>
				var url = "<%=basePath%>/sourcingcoll/fileupload.jsp";
				url = url + "?" + "uploadMode=<%=type%>";
				url = url + "&" + "userCode="+"${USER_CODE}";
				url = url + "&" + "pkReleaseFileB="+pk_release_file_b;
				url = url + "&" + "isNeedAddRow=Y";
				window.open(url,'' ,'width=640,height=350,location=no');
			}
			
			function addFileRow(pkReleaseFileB,replyFileName,replyFileSize,replyFilePath){
				var pubFileNaame;
				var pubFilePks = document.getElementsByName("pub_file_pk");
				var pubFileNames = document.getElementsByName("pub_file_name");
				for(var i=0;i<pubFilePks.length;i++){
					if(pubFilePks[i].value == pkReleaseFileB){
						pubFileNaame = pubFileNames[i].value;
						break;
					}
				}
				var fileTable = document.getElementById("bidFileTable");
				var rowNo = fileTable.rows.length;
				var row = fileTable.insertRow();
				row.id = rowNo;
				if(row.id%2==0){
			 		row.className="contTr-even";
			 	}else{
			 		row.className="contTr-old";
				 }
				 row.align = 'left';
				//序号
		 		var cell = row.insertCell()
		 		cell.className="td1";
		 		cell.innerHTML = "<td><input type='hidden' id='reply_file_real_path' name='reply_file_real_path' value='"+replyFilePath+replyFileName+"' />"+rowNo+"</td>";
				//采购文件名称
				cell = row.insertCell()
		 		cell.className="td1";
		 		cell.innerHTML = "<td><input type='hidden' id='pk_release_file_b' name='pk_release_file_b' value='"+pkReleaseFileB+"' />"+pubFileNaame+"</td>"; 
		 		//应答文件名称
				cell = row.insertCell()
		 		cell.className="td1";
		 		cell.innerHTML = "<td><input name='reply_file_name' id='reply_file_name' class='textinput5' readonly type='text' value='"+replyFileName+"' /></td>"; 
		 		//文件大小（字节）
				cell = row.insertCell()
		 		cell.className="td1";
		 		cell.innerHTML = "<td><span>"+subNumber(replyFileSize/1024)+"</span>KB"
		 		+"<input type='hidden' name='reply_file_size' id='reply_file_size' value='"+replyFileSize+"'/></td>";
		 		//备注
				cell = row.insertCell()
		 		cell.className="td1";
		 		cell.innerHTML = "<td><input name='fileMemo' id='fileMemo' style='width:95%' class='input-edit' type='text'/></td>";
		 		//删除
		 		cell = row.insertCell()
		 		cell.className="td1";
		 		cell.innerHTML = "<input type='button' class='buttondel' value='删除' onclick='delFile("+rowNo+")' />";
			}
			//下载文件
			function downloadFile(pk_file,file_name){
				document.replyform.pk_file.value = pk_file;
				document.replyform.file_name.value = file_name;
				document.replyform.action="<%=basePath%>/ebvpfile/download";
				document.replyform.submit();
			}
			//删除文件
			function delFile(index){
				var bidFileTable = document.getElementById("bidFileTable");
				if (bidFileTable != null) {
					// 获取报价信息有多少行
					var rows = bidFileTable.rows;
					if (rows != null && rows.length > 0) {
						for ( var pos = 0; pos < rows.length; pos++) {
							var row = rows[pos];
							// 寻找要删除的row
							if (row.id == index) {
								bidFileTable.deleteRow(pos);
								//deleteFile(index);
								break;
							}
						}
					}
				}
			}

			function subNumber(num){
				var value = (Math.round(Math.floor(num * 1000) / 10) / 100);
				return value;
			}

			var roundTwo2 = function() {
			    var objs = document.getElementsByName("showSize");
			    if(objs != null){
			     for(var i = 0; i < objs.length; i++){
			      if(objs[i].innerText != null && objs[i].innerText.length != 0)
			       objs[i].innerText = subNumber(objs[i].innerText);
			     }
			    }
			}
			roundTwo2();
			
			function deleteFile(pk_file){
				document.replyform.pk_file.value = pk_file;
				document.replyform.action="<%=basePath%>/ebvpfile/deletefile";
				//提交表单
				var options3 = {
					beforeSubmit : showRequest3, 
					success : showResponse3
				};
				$('#replyform').ajaxSubmit(options3);
			}
			function showRequest3(formData, jqForm, options) {
			}
			function showResponse3(responseText, statusText, xhr, $form) {
			}
			
			//文件验签
			function verifyFile(signature,index){
				var fileName = document.getElementsByName("fileName")[index-1].value
				var ret = verfiyFile(fileName,signature,"${SERVER_CERT}");
				if(ret)
					alert("验签成功");
				else
					alert("验签失败");
			}
			
			//刷新页面
			function refreshPage(){
				var url = "<%=basePath%>/sourcing/biddingprojlist/releasepurfileinfo?pkProj=${RELEASE_FORM.pk_pur_project}"+"&pkProjStep=${RELEASE_FORM.pk_purproj_step}"+"&type=<%=type%>";
				document.location.href = url;
			}
			
			//设置显示值
			//合计金额
			if(null != totalAmount){
				for(var i=0;i<totalAmount.length;i++){
					subReduNum(totalAmount[i],'${MONEY_PRECISION}');
				}
			}
			//数量
			if(null != amount){
				for(var i=0;i<amount.length;i++){
					if(null == amountPrecision[i] || typeof(amountPrecision[i]) === "undefined"){
						continue;
					}
					subReduNum(amount[i],amountPrecision[i].value);
				}
			}
			//含税单价
			if(null != hasTaxPrice){
				for(var i=0;i<hasTaxPrice.length;i++){
					subReduNum(hasTaxPrice[i],'${PRICE_PRECISION}');
				}
			}
			//税率
			if(null != taxRate){
				for(var i=0;i<taxRate.length;i++){
					subReduNum(taxRate[i],2);
				}
			}
			//折扣率
			if(null != detailDiscount){
				for(var i=0;i<detailDiscount.length;i++){
					subReduNum(detailDiscount[i],2);
				}
			}
			//折后价（含税净价或者无税竞价，统一取含税净价）
			if(null != hasTaxNetPrices){
				for(var i=0;i<hasTaxNetPrices.length;i++){
					subReduNum(hasTaxNetPrices[i],'${PRICE_PRECISION}');
				}
			}
			//折后金额（价税合计）
			if(null != priceTaxSums){
				for(var i=0;i<priceTaxSums.length;i++){
					subReduNum(priceTaxSums[i],'${MONEY_PRECISION}');
				}
			}

			//show message
			var showMsg = function(msg){
				document.getElementById('msg').innerText = msg;
			}
			//显示信息
			var afterReplyMsgShow = function(){
				var msg = "${msg}";
				if(msg != null && trim(msg).length != 0){
					if(msg == 'success'){
						msg = '提交成功！';
					}
					showMsg(msg);
				}
			}
			afterReplyMsgShow();
		</script>
	</body>
</html>
